package com.miage.itrading.server.business;

import java.io.Serializable;
import java.util.Date;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.miage.itrading.client.SGBDItrading;
import com.miage.itrading.shared.Const;

public class SGBDItradingImpl extends RemoteServiceServlet implements
		SGBDItrading, Serializable {

	private static final long	serialVersionUID	= 1L;

	public void metAJour() {

		/**
		 * Met à jour l'historique
		 */
		Date start = new Date();
		Historique h = new Historique();
		h.start();
		Date stop = new Date();

		System.out.println("Historique tracer: "
				+ ((stop.getTime() - start.getTime()) / 1000) + "sec");

		/**
		 * Lance le daemon temps réel
		 */
		if (Const.LANCER_TEMPS_REEL) {
			TempsReel tr = new TempsReel();
			tr.start();
		}
	}
}
